import { defineConfig } from 'vite'
import uni from '@dcloudio/vite-plugin-uni'
import path from 'path'
// https://vitejs.dev/config/
export default defineConfig({
	plugins: [uni()],
	resolve: {
		extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json'], // 确保包含 .js
		alias: {
			'@': path.resolve(__dirname, './src'),
			// 如果需要，还可以添加其他常用别名
			'@components': path.resolve(__dirname, './src/components'),
			'@static': path.resolve(__dirname, './src/static')
		}
	},
	optimizeDeps: {
	    include: ['paho-mqtt-min.js'] // 显式声明需要预构建
	  }
})